package com.xiaomi.eco.dal.enums;

public enum TaskStatusEnum {
    CONSULT(0, "优化中"),
    SUGGESTION(1, "已完成");

    private int code;

    private String name;

    TaskStatusEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static String getNameByCode(int code) {
        TaskStatusEnum[] values = values();
        for (TaskStatusEnum value : values) {
            if (value.getCode() == code) {
                return value.getName();
            }
        }
        return "";
    }
}
